// index.js
wx.cloud.init()

const app=getApp()
const db = wx.cloud.database({});

Page({

  data:{
    img_urls:[],
    url:[],
    tips:"<-点我进行搜索",
  },
  onShow: function(options) {
    console.log('img_urls',this.data.img_urls)
    var _this=this;
    db.collection('items').where({
      //id=114514,
    })
    
    .get({
      success: res =>{
        console.log('res.data',res.data);

        this.setData({
          img_urls:res.data
        })
      } 
    })
  },

  onTap1(){
    wx.redirectTo({
      url:'/pages/searchPage/searchPage',
    })
  },

  tapName: function(event){
    console.log(event)
    var Name=event.currentTarget.dataset.hi;
    console.log('first',Name)
    wx.redirectTo({
      url: '/pages/details/details?Name='+Name,
    })
  },
  goToSearch: function(){
    wx.navigateTo({
      url: '../search/search',
    })
  }
  }
)
